﻿using System.Windows;
using GameEngine.Clients.Silverlight;
using GameEngine.Model.Data;
using GameEngine.Model;
using GameEngine.Model.Data.implementation;
using PureMVC.Patterns;
using PureMVC.Interfaces;
using GameEngine.Clients.Silverlight.View.Components;
using GameEngine.Clients.Silverlight.View;
using System.Collections.Generic;
using MapEngine;
using System;
using SilverlightResources;
using SilverlightClientEditor;
using GameEditor.View;
using GameEditor.View.Components;
using SLPerlinNoise;
using System.Windows.Controls;
using System.Windows.Media.Imaging;

namespace ExampleSilverlight
{
    public class MyFacade : SampleSilverlightFacade
    {
        public static ViewStateVO deadState = new ViewStateVO("dead");

        //private const string STARTUP_COMMAND = "StartupCommand";

        // Override Singleton Factory method 
        public new static MyFacade Instance
        {
            get
            {
                return SampleSilverlightFacade.Instance as MyFacade;
            }
        }

        public void LoadGame(IGameVO<int> game)
        {
            if (game == null)
            {
                game = MyGame.CreateGame();
            }
            IGameDataProxy<int> gameDP = SilverlightApplicationFacadeHelper.CreateGame(game);
            SilverlightApplicationFacadeHelper.StartLevel(game.LevelOrder[game.CurrentLevel]);

            GameMenuUC gameScreen = new GameMenuUC(gameDP);
            SilverlightApplicationFacadeHelper.DesktopNavigate(gameScreen);
        }
    }
}
